// pages/client/client-contract/client-contract.js
import { getAgreement } from '../../../network/client';
Page({
  data: {
    agreement_id:'',
    info:{}
  },
  onLoad: function (options) {
    this.setData({
      agreement_id:options.agreement_id
    })
    this._getAgreement(this.data.agreement_id)
  },
  //      网络请求      //
  async _getAgreement(data){
    const res = await getAgreement(data)
    if(res.code===200){
      this.setData({
        info: res.data
      })
    }else{
      wx.showModal({
        title: '操作提示',
        content: '该合同还未签约或者其他问题',
        showCancel: false,
        success: (result) => {
          if(result.confirm){
            wx.navigateBack({
              delta: 1
            });
          }
        }
      });
    }
  }
})